<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://www.extremecomponents.org" prefix="ec"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="includeCSSjs.jsp" />
	
	<script type="text/javascript">
	
	$(document).ready(function() {
		$("#CatMateriaTemp").validate();
	});
	
	function onTableClick(	idGrado,
							grado	) {
		
		$("#idMateriaTemp").val(idGrado);
		$("#nombreTemp").val(grado);
		showEdit();
	}
	
	function showEdit() {
				$(".editbutton_div").hide("fast");
				$(".button_div").hide("slow");
				$(".editbutton_div").show("slow");

			}

			function hiddenEdit() {
				$(".editbutton_div").hide("fast");
				$(".button_div").show("slow");
			}
			
	</script>
	
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Grados Catalog</title>
</head>
<body>

<div id="container">

<!-- Aqui va el menu -->
<jsp:include page="menu.jsp" />
<div id="content">

<div id="top">
		<h2 class="divTextoEncabezado">Registro Materias Default</h2>
  </div>
<div id="leftSide">
  <fieldset>
<legend>Datos </legend>
	<form:form method="post" action="addCatMateriaTemp"
		commandName="CatMateriaTemp">
		<label for="nombreTemp">Nombre plantilla:</label>
			<div class="div_texbox">
				<form:input onkeypress="return soloLetras(event)" maxlength="250" path="nombreTemp" class="required textbox" id="nombreTemp"/>
				<form:errors path="*" cssClass="errorblock" element="div" />
		<form:hidden path="idMateriaTemp" id="idMateriaTemp" />
		</div>
		
	<div class="button_div">
		<input name="Submit" type="submit" value="Ingresar" class="buttons" />
	</div>
	<div class="editbutton_div" style="display: none">
		<input name="Submit" type="submit" value="Editar" class="buttons" 
		onclick="edit('CatMateriaTemp','editCatMateriaTemp')"/>
		<input name="Submit" type="submit" value="Eliminar" class="buttons" 
		onclick="edit('CatMateriaTemp','deleteCatMateriaTemp')"/>
		<input name="Submit" type="submit" value="Cancelar" class="buttons" 
		onclick="edit('CatMateriaTemp','showCatMateriaTemp')"/>
		<input name="Submit" type="submit" value="Materias" class="buttons" 
		onclick="edit('CatMateriaTemp','mostrarMaterias')"/>
	</div>
		
	</form:form>
		</fieldset>
</div>
  <div class="clear"></div>
		
		

		

				

	
	<!-- Extreme Table  -->
	<ec:table items="TbCatMateriaTempList"
		action="${pageContext.request.contextPath}/showCatMateriaTemp"
		view="compact"
		imagePath="${pageContext.request.contextPath}/resources/images/compact/*.gif"
		rowsDisplayed="8" autoIncludeParameters="false" var="grado">
		
		

		<ec:row highlightRow="true" 
		onclick="onTableClick(	'${pageScope.grado.idMateriaTemp}',								    					
    							'${pageScope.grado.nombreTemp}');">
			
			<ec:column property="nombreTemp" title="Nombre Template"/>			
		</ec:row>
	</ec:table>
	
	</div>



</div>
	
</body>
</html>